package com.yuji.aacar.net.bean;


import com.yuji.aacar.net.config.HttpConfig;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * <li>Date: 2017/2/15 </li>
 * <li>Description: 业务请求头 </li>
 */
public class HttpCoreRequestHeader implements Serializable {
    private String channelCode;//渠道号
    private String token; //加密的token
    private String version;//	客户端当前软件版本号 如：1.6.1	必选
    private String deviceType;//	应用名称 如：android_business	必选
    private String uuUserId;//	移动设备唯一标识 如：356871046400838	必选
    private int service;//	接口服务编号 如：3001	必选
    private int dataSize = 0;//消息数据大小
    private String deviceTokens;//设备号
    private String userId;//绑定了手机号的ID
    private String sign; //加密签名，后台加息的


    public HttpCoreRequestHeader(int service) {
        this.service = service;
        init();
    }

    public void init() {
        channelCode = HttpConfig.getChannelCode();
        deviceType = HttpConfig.getDeviceType();
        uuUserId = HttpConfig.getUuUserId();
        version = HttpConfig.getVersion();
        token = HttpConfig.getToken();
        userId = HttpConfig.getUserId();
//        deviceTokens = HttpConfig.getDeviceTokens();
    }

    public String getVersion() {
        return version;
    }


    public void setVersion(String version) {
        this.version = version;
    }


    public String getDeviceType() {
        return deviceType;
    }


    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }


    public String getUuUserId() {
        return uuUserId;
    }


    public void setUuUserId(String uuUserId) {
        this.uuUserId = uuUserId;
    }



    public int getService() {
        return service;
    }


    public void setService(int service) {
        this.service = service;
    }

//    public Ext getExt() {
//        return ext;
//    }
//
//    public void setExt(Ext ext) {
//        this.ext = ext;
//    }

    public int getDataSize() {
        return dataSize;
    }

    public void setDataSize(int dataSize) {
        this.dataSize = dataSize;
    }

    public String getDeviceTokens() {
        return deviceTokens;
    }

    public void setDeviceTokens(String deviceTokens) {
        this.deviceTokens = deviceTokens;
    }

    /**
     * 获取当前时间
     *
     * @return
     */
    private static final String getCurrentTime() {
        long time = System.currentTimeMillis();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date(time);
        return format.format(date);
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }
}
